package cn.com.yiqi.wsc.dao.lottery;

import cn.com.yiqi.wsc.Ro.AwardVO;
import cn.com.yiqi.wsc.Ro.LotterRecordVO;
import cn.com.yiqi.wsc.Ro.PortalLotteryRecordVO;
import cn.com.yiqi.wsc.dao.customer.criteria.CustomerCriteria;
import cn.com.yiqi.wsc.dao.lottery.criteria.LotteryActivityCriteria;
import cn.com.yiqi.wsc.entity.lottery.LotteryRecord;
import cn.com.yiqi.wsc.entity.lottery.LotteryRecordExample;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

@Repository
public interface LotteryRecordMapper {

    int deleteByPrimaryKey(Integer id);

    int insertSelective(LotteryRecord record);

    List<LotteryRecord> selectByExample(LotteryRecordExample example);

    LotteryRecord selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(LotteryRecord record);

    List<LotterRecordVO> findRecordVo(@Param("limit") Integer limit,@Param("isWin") Integer isWin,@Param("userId") Integer userId,@Param("hasTel") Integer hasTel,@Param("activityId") Integer activityId);

    Integer countTimes(@Param("userId") Integer userId, @Param("activityId") int i);

    LotteryRecord findByIdAndUserId(@Param("id") Integer id, @Param("userId") Integer userId);

    /**
     * 总共参与过多少次
     */
    Integer countByAllTime(@Param("userId") Integer userId,@Param("activityId") Integer activityId);

    List<PortalLotteryRecordVO> selectLotteryRecord(CustomerCriteria customerCriteria);


    /**
     * 获取获奖记录
     *
     * @param activityId
     * @return
     */
    List<AwardVO> selectLotteryRecordByActivityId(@Param("activityId") Integer activityId);
}